﻿namespace CodeContrib
{
	public static class SlugExtensions
	{
		public static string ToSlug(this string value)
		{
			if (string.IsNullOrWhiteSpace(value))
			{
				return value;
			}

			return value.RemoveDiacritics().ToLowerInvariant().ReplaceNonWordWithDashes().Trim(' ', '-');
		}
	}
}